<?php
/**
 * Field Match Rule
 * Validate that one field matches another field.
 * 
 * @package     Q-Validate
 * @subpackage  Rules
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: Match.php 37 2010-12-23 02:38:44Z luke.visinoni $
 */
class Q_Rule_Match extends Q_Rule_Abstract {

    /**
     * The parameters that were passed to this rule
     */
    protected $_params = array(
        'match' => null,
    );
    /**
     * 
     */
    public function isValid($value) {
    
        if (!isset($this->_data[$this->getParam('match')])) return false;
        if ($value == $this->_data[$this->getParam('match')]) return true;
        return false;
    
    }

}
